waypt: Be more verbose when stopping because of invalid coordinates.
authoroliskoli <oliskoli>
Sun, 15 Apr 2007 19:08:51 +0000 (19:08 +0000)
committeroliskoli <oliskoli>
Sun, 15 Apr 2007 19:08:51 +0000 (19:08 +0000)
waypt.c

diff --git a/waypt.c b/waypt.c
index 7c8f40487769e7d6a83600e36f093638897a9a01..b884eba086163543582d466a6f78f4ea80160dad 100644 (file)
--- a/waypt.c
+++ b/waypt.c
@@ -97,9 +97,11 @@ waypt_add(waypoint *wpt)
        waypt_ct++;
 
        if ((wpt->latitude < -90) || (wpt->latitude > 90.0))
-               fatal ("Invalid latitude %f in waypoint.\n", wpt->latitude);
+               fatal ("Invalid latitude %f in waypoint %s.\n",
+                       wpt->latitude, wpt->shortname ? wpt->shortname : "");
        if ((wpt->longitude < -180) || (wpt->longitude > 180.0))
-               fatal ("Invalid longitude %f in waypoint.\n", wpt->longitude);
+               fatal ("Invalid longitude %f in waypoint %s.\n",
+                       wpt->longitude, wpt->shortname ? wpt->shortname : "");
 
        /*
         * Some input may not have one or more of these types so we